<?php

	class baseControl extends Control {
		
		public function contentPage($content,$id){
			$pageNow = empty($_GET["page"])?1:$_GET["page"];
			$str = trim($content);
		    $bodyy=strip_tags($str,"<p>,<br>");
			$body=nl2br($bodyy);
		    $totalCount = mb_strlen($body,"utf-8");
		    $pageSize = 800;
			$pageNum = ceil($totalCount/$pageSize);
           //p($body);p(($pageNow-1)*$pageSize);p($pageSize);exit();
			$contentData = mb_substr($body, ($pageNow-1)*$pageSize,$pageSize,"utf-8");
//			p($contentData);
//			exit();
			$this->assign("data",$contentData);
    
			$pageBar = "";
			
			for($i=1;$i<=$pageNum;$i++){
				$pageBar=$pageBar."<a href=".__APP__."/body/index/id/$id/page/$i>".$i."</a>
				&nbsp;&nbsp;";
			}
			return $pageBar;
		}
	}
?>